﻿using FluentNHibernate.Mapping;
using Shake.Domain.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Shake.Domain.Maps
{
    public class DepartmentMap : ClassMap<Department>
    {
        public DepartmentMap()
        {
            this.Table("Department");
            this.Id(t => t.Id).Column("Id").Length(32).Not.Nullable();
            this.Map(t => t.Name).Column("Name").Length(10).Not.Nullable();

            this.Map(t => t.ParentId).Column("ParentId");
            this.Map(t => t.Path).Column("Path");
            this.Map(t => t.Sort).Column("Sort").Not.Nullable();
        }
    }
}
